home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / prog_bas / mquery.zip / MFIND.FRM < prev    next >
Text File  |  1994-05-24  |  5KB  |  187 lines

  1. VERSION 2.00
  2. Begin Form fFind 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Find Record"
  6.    ClientHeight    =   2370
  7.    ClientLeft      =   2025
  8.    ClientTop       =   2625
  9.    ClientWidth     =   5070
  10.    ControlBox      =   0   'False
  11.    Height          =   2835
  12.    Left            =   1935
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2412
  17.    ScaleMode       =   0  'User
  18.    ScaleWidth      =   5160
  19.    Top             =   2250
  20.    Width           =   5250
  21.    Begin ListBox cFieldList 
  22.       BackColor       =   &H00FFFFFF&
  23.       Height          =   1368
  24.       Left            =   240
  25.       TabIndex        =   2
  26.       Tag             =   " OL"
  27.       Top             =   360
  28.       Width           =   1692
  29.    End
  30.    Begin ListBox cOpsList 
  31.       BackColor       =   &H00FFFFFF&
  32.       Height          =   1368
  33.       Left            =   2040
  34.       TabIndex        =   7
  35.       Tag             =   " OL"
  36.       Top             =   360
  37.       Width           =   960
  38.    End
  39.    Begin TextBox cExpr 
  40.       BackColor       =   &H00FFFFFF&
  41.       Height          =   287
  42.       Left            =   3120
  43.       TabIndex        =   1
  44.       Tag             =   " OL"
  45.       Top             =   360
  46.       Width           =   1811
  47.    End
  48.    Begin CheckBox cMatchCase 
  49.       BackColor       =   &H00C0C0C0&
  50.       Caption         =   "Match Case"
  51.       Height          =   252
  52.       Left            =   3120
  53.       TabIndex        =   8
  54.       Top             =   839
  55.       Width           =   1811
  56.    End
  57.    Begin CommandButton OkayButton 
  58.       Caption         =   "&OK"
  59.       Default         =   -1  'True
  60.       Enabled         =   0   'False
  61.       Height          =   372
  62.       Left            =   600
  63.       TabIndex        =   4
  64.       Top             =   1919
  65.       Width           =   1691
  66.    End
  67.    Begin CommandButton CancelButton 
  68.       Cancel          =   -1  'True
  69.       Caption         =   "&Cancel"
  70.       Height          =   372
  71.       Left            =   2879
  72.       TabIndex        =   5
  73.       Top             =   1919
  74.       Width           =   1691
  75.    End
  76.    Begin Label OpsLabel 
  77.       BackColor       =   &H00C0C0C0&
  78.       Caption         =   "Operators:"
  79.       Height          =   192
  80.       Left            =   2039
  81.       TabIndex        =   6
  82.       Top             =   120
  83.       Width           =   971
  84.    End
  85.    Begin Label FieldListLabel 
  86.       BackColor       =   &H00C0C0C0&
  87.       Caption         =   "Fields:"
  88.       Height          =   192
  89.       Left            =   240
  90.       TabIndex        =   3
  91.       Top             =   120
  92.       Width           =   1092
  93.    End
  94.    Begin Label ExprLabel 
  95.       BackColor       =   &H00C0C0C0&
  96.       Caption         =   "Value or Expression:"
  97.       Height          =   192
  98.       Left            =   3120
  99.       TabIndex        =   0
  100.       Top             =   120
  101.       Width           =   1811
  102.    End
  103. End
  104. Option Explicit
  105. Dim FNotFound As Integer
  106.  
  107. Sub CancelButton_Click ()
  108.   Hide
  109.   'set the flag for the dynaset/dynagrid form
  110.   gfFindFailed = True
  111. End Sub
  112.  
  113. Sub cExpr_Change ()
  114.   If cFieldList <> "" And cOpsList <> "" And cExpr <> "" Then
  115.     OkayButton.Enabled = True
  116.   Else
  117.     OkayButton.Enabled = False
  118.   End If
  119. End Sub
  120.  
  121. Sub cFieldList_Click ()
  122.   If cFieldList <> "" And cOpsList <> "" And cExpr <> "" Then
  123.     OkayButton.Enabled = True
  124.   Else
  125.     OkayButton.Enabled = False
  126.   End If
  127. End Sub
  128.  
  129. Sub cOpsList_Click ()
  130.   If cFieldList <> "" And cOpsList <> "" And cExpr <> "" Then
  131.     OkayButton.Enabled = True
  132.   Else
  133.     OkayButton.Enabled = False
  134.   End If
  135. End Sub
  136.  
  137. Sub Form_Load ()
  138.    Me.Left = (screen.Width - Me.Width) / 2
  139.    Me.Top = (screen.Height - Me.Height) / 2
  140.  
  141.  
  142.   FNotFound = False
  143.   cOpsList.AddItem "="
  144.   cOpsList.AddItem "<>"
  145.   cOpsList.AddItem ">="
  146.   cOpsList.AddItem "<="
  147.   cOpsList.AddItem ">"
  148.   cOpsList.AddItem "<"
  149.   cOpsList.AddItem "Like"
  150. End Sub
  151.  
  152. Sub Form_Paint ()
  153.   Outlines Me
  154. End Sub
  155.  
  156. Sub OkayButton_Click ()
  157.    Dim i As Integer
  158.  
  159.    On Error GoTo FindErr
  160.  
  161.    i = cFieldList.ListIndex
  162.    FNotFound = False
  163.    SetHourGlass Me
  164.  
  165.    gstFindField = cFieldList
  166.    gstFindExpr = cExpr
  167.    gstFindOp = cOpsList
  168.    gfFindMatch = cMatchCase
  169.  
  170.    Hide
  171.    GoTo FindEnd
  172.  
  173. FindErr:
  174.    If Err <> EOF_ERR Then
  175.      ShowError
  176.      Resume FindEnd
  177.    Else
  178.      FNotFound = True
  179.      Resume Next
  180.    End If
  181.  
  182. FindEnd:
  183.    ResetMouse Me
  184.  
  185. End Sub
  186.  
  187.